home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / CHIP 2005-06.iso / program / yazilim / myscreencapture.exe / {app} / Demo VB6 / frmMain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2005-04-08  |  8.1 KB  |  227 lines

  1. VERSION 5.00
  2. Object = "{9F485643-72B2-4DEC-8F9E-F2D2E296DA40}#1.0#0"; "MYSCREENCAPTURE.OCX"
  3. Begin VB.Form frmMain 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "My ScreenCapture Quick demo 1.1 - (c) namtuk.com"
  6.    ClientHeight    =   5985
  7.    ClientLeft      =   45
  8.    ClientTop       =   435
  9.    ClientWidth     =   8265
  10.    Icon            =   "frmMain.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    Picture         =   "frmMain.frx":1CFA
  15.    ScaleHeight     =   5985
  16.    ScaleWidth      =   8265
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.CheckBox chkSaveDiskJPEG 
  19.       BackColor       =   &H00E3CDA4&
  20.       Caption         =   "Save a copy in JPEG"
  21.       Enabled         =   0   'False
  22.       Height          =   225
  23.       Left            =   315
  24.       TabIndex        =   10
  25.       Top             =   5145
  26.       Width           =   2220
  27.    End
  28.    Begin VB.CommandButton cmdQuit 
  29.       Caption         =   "Quit"
  30.       Height          =   435
  31.       Left            =   2625
  32.       TabIndex        =   9
  33.       Top             =   5460
  34.       Width           =   3900
  35.    End
  36.    Begin VB.CheckBox chkSaveDisk 
  37.       BackColor       =   &H00E2C99F&
  38.       Caption         =   "Save capture to disk (BMP)"
  39.       Height          =   330
  40.       Left            =   105
  41.       TabIndex        =   8
  42.       Top             =   4725
  43.       Width           =   2430
  44.    End
  45.    Begin VB.CheckBox chkClipboard 
  46.       BackColor       =   &H00DFC296&
  47.       Caption         =   "Send capture to clipboard"
  48.       Height          =   330
  49.       Left            =   105
  50.       TabIndex        =   7
  51.       Top             =   4305
  52.       Width           =   2430
  53.    End
  54.    Begin VB.CommandButton cmdCaptureSpecific 
  55.       Caption         =   "Capture specific window"
  56.       Height          =   540
  57.       Left            =   210
  58.       TabIndex        =   6
  59.       Top             =   3675
  60.       Width           =   1905
  61.    End
  62.    Begin VB.CommandButton cmdCaptureManual 
  63.       Caption         =   "Capture manually"
  64.       Height          =   540
  65.       Left            =   210
  66.       TabIndex        =   5
  67.       Top             =   3045
  68.       Width           =   1905
  69.    End
  70.    Begin VB.CommandButton cmdCaptureZone 
  71.       Caption         =   "Capture predefined zone"
  72.       Height          =   540
  73.       Left            =   210
  74.       TabIndex        =   4
  75.       Top             =   2415
  76.       Width           =   1905
  77.    End
  78.    Begin VB.CommandButton cmdCaptureActive 
  79.       Caption         =   "Capture Active window"
  80.       Height          =   540
  81.       Left            =   210
  82.       TabIndex        =   3
  83.       Top             =   1785
  84.       Width           =   1905
  85.    End
  86.    Begin VB.CommandButton cmdCaptureFullScreen 
  87.       Caption         =   "Capture full screen"
  88.       Height          =   540
  89.       Left            =   210
  90.       TabIndex        =   2
  91.       Top             =   1155
  92.       Width           =   1905
  93.    End
  94.    Begin VB.PictureBox Picture1 
  95.       Appearance      =   0  'Flat
  96.       BackColor       =   &H80000005&
  97.       ForeColor       =   &H80000008&
  98.       Height          =   4110
  99.       Left            =   2625
  100.       ScaleHeight     =   4080
  101.       ScaleWidth      =   5550
  102.       TabIndex        =   0
  103.       Top             =   1260
  104.       Width           =   5580
  105.    End
  106.    Begin MyScreenCapture.MyCapture MyCapture1 
  107.       Left            =   2235
  108.       Top             =   795
  109.       _ExtentX        =   741
  110.       _ExtentY        =   741
  111.    End
  112.    Begin VB.Label Label3 
  113.       Alignment       =   2  'Center
  114.       BackStyle       =   0  'Transparent
  115.       Caption         =   "This is a sample demo available only for Programmers and Developers. This is not a full application."
  116.       BeginProperty Font 
  117.          Name            =   "Arial"
  118.          Size            =   9.75
  119.          Charset         =   0
  120.          Weight          =   700
  121.          Underline       =   0   'False
  122.          Italic          =   0   'False
  123.          Strikethrough   =   0   'False
  124.       EndProperty
  125.       ForeColor       =   &H00C0C0FF&
  126.       Height          =   960
  127.       Left            =   4410
  128.       TabIndex        =   11
  129.       Top             =   0
  130.       Width           =   3795
  131.    End
  132.    Begin VB.Label Label1 
  133.       Alignment       =   2  'Center
  134.       BackStyle       =   0  'Transparent
  135.       Caption         =   "Picture to show part of the capture sample"
  136.       BeginProperty Font 
  137.          Name            =   "Tahoma"
  138.          Size            =   9.75
  139.          Charset         =   0
  140.          Weight          =   700
  141.          Underline       =   0   'False
  142.          Italic          =   0   'False
  143.          Strikethrough   =   0   'False
  144.       EndProperty
  145.       ForeColor       =   &H00FFFFFF&
  146.       Height          =   330
  147.       Left            =   2625
  148.       TabIndex        =   1
  149.       Top             =   1050
  150.       Width           =   5580
  151.    End
  152. Attribute VB_Name = "frmMain"
  153. Attribute VB_GlobalNameSpace = False
  154. Attribute VB_Creatable = False
  155. Attribute VB_PredeclaredId = True
  156. Attribute VB_Exposed = False
  157. Option Explicit
  158. Private Sub chkClipboard_Click()
  159.     MyCapture1.SendToClipboard = chkClipboard.Value
  160.     If chkClipboard.Value = 1 Then
  161.         MsgBox "Now, the screen capture will be also send to clipboard", vbInformation + vbOKOnly, "Information"
  162.     End If
  163. End Sub
  164. Private Sub chkSaveDisk_Click()
  165.     MyCapture1.FileName = "c:\Test capture My ScreenCapture.bmp"
  166.     MyCapture1.SendToDisk = chkSaveDisk.Value
  167.     If chkSaveDisk.Value = 1 Then
  168.         chkSaveDiskJPEG.Enabled = True
  169.         MsgBox "Now, the screen capture will be also saved in c:\Test capture My ScreenCapture.bmp", vbInformation + vbOKOnly, "Information"
  170.     Else
  171.         chkSaveDiskJPEG.Enabled = False
  172.     End If
  173. End Sub
  174. Private Sub chkSaveDiskJPEG_Click()
  175.     'Just to show example to save in JPEG format
  176.     If chkSaveDiskJPEG.Value = 1 Then
  177.         MsgBox "A copy of the screen capture will be also saved in c:\Test capture My ScreenCapture.jpg", vbInformation + vbOKOnly, "Information"
  178.     End If
  179. End Sub
  180. Private Sub cmdCaptureFullScreen_Click()
  181.     Set Picture1 = MyCapture1.CaptureFullScreen
  182.     If chkSaveDiskJPEG.Value = 1 Then mSaveToJPEG
  183. End Sub
  184. Private Sub cmdCaptureActive_Click()
  185.     Set Picture1 = MyCapture1.CaptureActiveWindows
  186.     If chkSaveDiskJPEG.Value = 1 Then mSaveToJPEG
  187. End Sub
  188. Private Sub cmdCaptureZone_Click()
  189.     MyCapture1.RegionX = 200
  190.     MyCapture1.RegionY = 200
  191.     MyCapture1.RegionWidth = 300
  192.     MyCapture1.RegionHeight = 300
  193.     Set Picture1 = MyCapture1.CaptureRegionAuto
  194.     If chkSaveDiskJPEG.Value = 1 Then mSaveToJPEG
  195. End Sub
  196. Private Sub cmdCaptureManual_Click()
  197.     Set Picture1 = MyCapture1.CaptureRegionManual
  198.     If chkSaveDiskJPEG.Value = 1 Then mSaveToJPEG
  199. End Sub
  200. Private Sub cmdCaptureSpecific_Click()
  201.     Set Picture1 = MyCapture1.CaptureSpecificWindows(Me.hwnd)
  202.     If chkSaveDiskJPEG.Value = 1 Then mSaveToJPEG
  203. End Sub
  204. Private Sub cmdQuit_Click()
  205.     End
  206. End Sub
  207. Private Sub mSaveToJPEG()
  208. '---------------------------------------------------------------------------------------
  209. ' ##DateTime 13-Oct-2004 10:39
  210. ' ##Update 13-Oct-2004 10:39
  211. ' ##Summary  Example of using the FREE dll from Intel to save in JPEG format
  212. ' ##Revision None
  213. '---------------------------------------------------------------------------------------
  214. Dim c As New cDIBSection
  215.     On Error Resume Next
  216.     c.CreateFromPicture Picture1.Picture
  217.     SaveJPG c, "c:\Test capture My ScreenCapture.jpg", 90
  218.     Set c = Nothing
  219. End Sub
  220. Private Sub Form_Load()
  221. Dim sMessageForEndUser As String
  222.     sMessageForEndUser = "We inform you that the product you will try is a demonstration FOR DEVELOPMENT PURPOSE ONLY. It is not an application for final user." & vbCrLf & vbCrLf
  223.     sMessageForEndUser = sMessageForEndUser & "Nous vous informons que le produit que vous allez tester est une d
  224. monstration pour les programmeurs uniquement. Ce n'est pas un programme pour utilisateur final."
  225.     MsgBox sMessageForEndUser
  226. End Sub
  227.